package com.d3works.apps.businesssupport.service;

import com.d3works.apps.base.service.AddressService;
import com.d3works.apps.base.service.PartnerService;
import com.d3works.apps.businessproject.service.ProjectBusinessServiceImpl;
import com.d3works.apps.businessproject.service.app.AppBusinessProjectService;
import com.d3works.apps.project.db.Project;
import com.d3works.apps.project.db.ProjectTask;
import com.d3works.apps.project.db.TaskTemplate;
import com.d3works.apps.project.db.repo.ProjectRepository;
import com.d3works.apps.project.db.repo.ProjectStatusRepository;
import com.d3works.apps.project.db.repo.ProjectTemplateRepository;
import com.d3works.apps.project.service.app.AppProjectService;
import com.google.inject.Inject;
import java.util.Set;

public class ProjectBusinessSupportServiceImpl extends ProjectBusinessServiceImpl {

  @Inject
  public ProjectBusinessSupportServiceImpl(
      ProjectRepository projectRepository,
      ProjectStatusRepository projectStatusRepository,
      ProjectTemplateRepository projTemplateRepo,
      AppProjectService appProjectService,
      PartnerService partnerService,
      AddressService addressService,
      AppBusinessProjectService appBusinessProjectService) {
    super(
        projectRepository,
        projectStatusRepository,
        projTemplateRepo,
        appProjectService,
        partnerService,
        addressService,
        appBusinessProjectService);
  }

  @Override
  public ProjectTask createTask(
      TaskTemplate taskTemplate, Project project, Set<TaskTemplate> taskTemplateSet) {

    ProjectTask task = super.createTask(taskTemplate, project, taskTemplateSet);
    task.setInternalDescription(taskTemplate.getInternalDescription());

    return task;
  }
}
